/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package miselania.Almacenamiento;
import java.util.ArrayList;
import java.util.List;
/**
 *
 * @author jhon
 */
public class Problema2 {
    public static void main(String[] args) {
        
            List<Atributo> attrs = new ArrayList<>();
        
        
            attrs.add(new Atributo("character", Character.class));
            attrs.add(new Atributo("byte", Byte.class));
            attrs.add(new Atributo("short", Short.class));
            attrs.add(new Atributo("integer", Integer.class));
            attrs.add(new Atributo("long", Long.class));
            attrs.add(new Atributo("float", Float.class));
            attrs.add(new Atributo("double", Double.class));
            attrs.add(new Atributo("string", String.class));
            Relacion rel = new Relacion(attrs);

            
            
            
            List<Comparable> v1 = new ArrayList<>();
            v1.add(new Character('b'));
            v1.add(new Byte((byte) 30));
            v1.add(new Short((short) 315));
            v1.add(new Integer(2050));
            v1.add(new Long(34587));
            v1.add(new Float(15.3));
            v1.add(new Double(30.6));
            boolean add = v1.add("guidosh");
            
            
           
            
            
            Tupla t1 = new Tupla(new IdentificadorTupla("redes", 1), v1);
          
            
            List<Tupla> lis = new ArrayList<>();
            
            for (int i = 0; i < 20; i++) {
            lis.add(t1);
            
            
        }
              
            /*crear una pagina con ranura*/
            
            //crear identificador
            IdentificadorPagina pid1 = new IdentificadorPagina("a", 0);
            PaginaConRanuras pranura=new PaginaConRanuras(rel, pid1);
            
            
            
            System.out.println("PAGINAS");
            for (Tupla tuplas:lis){
            pranura.adicionarTupla(tuplas);
            System.out.println();
            
            System.out.println(pranura);
            System.out.println();
            System.out.println("============================================================");
            System.out.print(" CABECERA: "+pranura.getArrayubicaciontamaño());
            System.out.print(" POSICION FINAL  CABECERA: "+pranura.getFincabecera());
            System.out.print(" POSICIO DEL  ESPACIO LIBRE: "+pranura.getFinespaciolibre());
            System.out.print(" ESPACIO LIBRE: "+pranura.getEspacioLibre());
            }
            
            
            
                
    } 
}
